//
//  WeatherDetailView.m
//  ExploreWorld
//
//  Created by dlios on 15/7/15.
//  Copyright (c) 2015年 chenlin. All rights reserved.
//

#import "WeatherDetailView.h"

@implementation WeatherDetailView
- (void)dealloc
{
    [self.weatherImageView release];
    [self.gradeLable release];
    [self.PM25 release];
    [self.sk_sd release];
    [super dealloc];
}

- (instancetype)initWithFrame:(CGRect)frame
{
    self = [super initWithFrame:frame];
    if (self) {
        [self createMyWeatherDetailView];
    }
    return self;
}




- (void)createMyWeatherDetailView
{
    float wid = self.frame.size.width;
    float hei = self.frame.size.height / 8;
    
    UILabel *l = [[UILabel alloc]initWithFrame:CGRectMake(0, 0, wid, hei)];
    [l setText:@"空气质量"];
    [l setTextColor:[UIColor blackColor]];
    [l setFont:[UIFont systemFontOfSize:14]];
    [self addSubview:l];
    [l release];
    
    self.weatherImageView = [[UIImageView alloc]initWithFrame:CGRectMake(10, hei * 2, hei * 5, hei * 5)];
    [self.weatherImageView setBackgroundColor:[UIColor blackColor]];
    [self addSubview:self.weatherImageView];
    
    
    self.gradeLable = [[UILabel alloc]initWithFrame:CGRectMake(20 + hei * 5,hei * 3 , wid - hei * 5 - 20, hei)];
    [self.gradeLable setFont:[UIFont systemFontOfSize:12]];
    [self.gradeLable setTextColor:[UIColor greenColor]];
    [self addSubview:self.gradeLable];
    
    
    self.PM25 = [[UILabel alloc]initWithFrame:CGRectMake(20 + hei * 5, hei * 4,  wid - hei * 5 - 20, hei)];
    [self.PM25 setFont:[UIFont systemFontOfSize:12]];
    [self.PM25 setTextColor:[UIColor blueColor]];
    [self addSubview:self.PM25];
    
    
    
    self.sk_sd = [[UILabel alloc]initWithFrame:CGRectMake(20 + hei * 5, hei * 5,  wid - hei * 5 - 20, hei)];
    [self.sk_sd setFont:[UIFont systemFontOfSize:12]];
   // [self.sk_sd setBackgroundColor:[UIColor blackColor]];
    [self.sk_sd setTextColor:[UIColor redColor]];
    [self addSubview:self.sk_sd];
}

@end
